﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocumentoVentaEditForm.aspx.cs" 
Inherits="UILGestion.VentaAdmin.DocumentoVenta.DocumentoVentaEditForm" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>

<%@ Register src="DocumentoVentaItemGrid.ascx" tagname="DocumentoVentaItemGrid" tagprefix="uc2" %>

<%@ Register src="../RendicionVenta/PendientePagoPanel.ascx" tagname="PendientePagoPanel" tagprefix="uc3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
    <script src="../../Scripts/DocumentoVenta.js" type="text/javascript"></script>


 <style type="text/css">

table {border-collapse:collapse}
#dispo td{
	border:thin solid #007FFF;
	height: 20px;
	text-align: center;
}
#leyenda td{
	border:thin solid #007FFF;
}

     .style1
     {
         height: 99px;
     }

 </style>
    <title>Registro de Etapa Venta</title>
    
    <script src="../../Scripts/DocumentoVenta.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.5.2.min.js" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function () {
           $(document).bind('contextmenu', function (e) {
               return false;
           });
       });
</script>


    <script src="../../Scripts/SearchResult.js" type="text/javascript"></script>
  
   
   
    </head>
<body>
    <form id="form1" runat="server">
    <input id="type" type="hidden" runat="server" />
    <input id="internalID" type="hidden" runat="server" />
    <input id="idEtapa" type="hidden" runat="server" />
    
    <input id="paginaAnt" type="hidden" runat="server" />
    <input id="idProyecto" type="hidden" runat="server" />
    
    <input id="idColeccion" type="hidden" runat="server" />
    <input id="idMoneda" type="hidden" runat="server" />
    <input id="idColeccionLista" type="hidden" runat="server" />
   
     <uc1:menuCtrl ID="menuCtrl1" runat="server" />
    
     <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" 
      EnableScriptGlobalization="true"  
     EnablePartialRendering="true" />
    
     <asp:Panel ID="pnlMain" runat="server"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
  <asp:Label ID="Label2" runat="server" Text="DOCUMENTO VENTA" 
             style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>

          <asp:Panel ID="PanelButtom" runat="server"     class="ms-crm-Form-Body" >                 
   <table >
<tr>

<td>
    <asp:Button ID="saveBTN" runat="server" Text="Guardar"   OnClientClick="return confirm('Usted quiere guardar la Documento Venta?')"   
       OnClick="button"   CssClass="ms-crm-List-Header"    /></td>
<td>
    <asp:Button ID="cancelarBTN" runat="server" Text="Cancelar"  
       OnClick="button" CssClass="ms-crm-List-Header"  /></td>
        <td></td>
        <td>
    <asp:Button ID="refreshBTN" runat="server" Text="Restablecer"   OnClick="button" CssClass="ms-crm-List-Header" 
          /></td> 
 
</tr>
</table>
</asp:Panel>

<asp:Panel ID="PanelBody" runat="server"  BackColor="white" >



                
                <table>
                   
                    <tr>
                        <td rowspan="9" valign="top"  >
               
                                     <table>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Tipo Documento:</td>
                                             <td width="280px">
                                                 <asp:DropDownList ID="tipoDocumentoDDL" runat="server" 
                                                      Width="250px"  AutoPostBack="true"
                                                     onselectedindexchanged="DDL">
                                                 </asp:DropDownList>
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Num Documento:</td>
                                             <td width="280px">
                                                 <asp:UpdatePanel ID="numDocumentoUPNL" runat="server" UpdateMode="Conditional">
                                                 <ContentTemplate>
                                                 <asp:TextBox ID="serieLBL" runat="server" Text="" Width="50px"></asp:TextBox>
                                                     <asp:TextBox ID="numDocumentoTXT" runat="server" Text="" Width="100px"></asp:TextBox>
                                                 </ContentTemplate>
                                                 <Triggers>
                                                 <asp:AsyncPostBackTrigger ControlID="tipoDocumentoDDL" />
                                                 </Triggers>
                                                 </asp:UpdatePanel>
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Fecha:</td>
                                             <td width="280px">
                                                 <asp:TextBox ID="fechaTXT" runat="server" Width="70px"></asp:TextBox>
                                                 <asp:ImageButton ID="ImageButton3" runat="Server" 
                                                     AlternateText="Click aqui para mostrar calendario" 
                                                     ImageUrl="~/Images/month.gif" Width="16px" />
                                               <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                     PopupButtonID="ImageButton3" TargetControlID="fechaTXT">
                                                 </asp:CalendarExtender>
            
                                             </td>
                                         </tr>
                                          <tr>
                                              <td align="right" width="100px">
                                                  Cliente:</td>
                                              <td width="280px">
                                                  <asp:HyperLink ID="clienteHLK" runat="server" ForeColor="Blue" ToolTip="Ir a datos del  cliente"></asp:HyperLink>
                                                  <lib:Input  id="idClienteTXT"  ReadOnly="true" BackColor="Transparent" Width="0px" runat="server" />
                                                  <lib:Input ID="idOrdenVentaItemTXT" runat="server" BackColor="Transparent" 
                                                      ReadOnly="true" Width="0px" />
                                              </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Doc Cliente:
                                             </td>
                                             <td width="280px">
                                                 <asp:Label ID="TipoDocClienteLBL" runat="server" Text=""></asp:Label>
                                                 <asp:Label ID="NumDocuClienteLBL" runat="server" Text=""></asp:Label>
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px" valign="top">
                                                 Direccion:</td>
                                             <td width="280px" rowspan="2" valign="top">

           

                                                 <asp:Label ID="direccionLBL" runat="server" Text=""></asp:Label>

           

                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                         </tr>
                           
                                         <tr>
                                             <td align="right" width="100px" valign="top">
                                                 UI:</td>
                                             <td width="280px" valign="top">
                                             
                                                 <asp:Literal ID="UILBL" runat="server" Text=""></asp:Literal>
                                             </td>
                                         </tr>
                           
                        </table>
               
                        </td>
                    </tr>
                  
               
                    <tr >
                        <td style="text-align: right" valign="top">
                       
                            Orden Venta:</td>
                        <td valign="top">
                           
                            <asp:HyperLink ID="ordenVentaHLK" runat="server" ForeColor="Blue" ToolTip="Ir a la Orden Venta"></asp:HyperLink>
                        </td>
                        <td rowspan="4" align="right" width="180px" >
                           
                            <asp:UpdatePanel ID="totalUPNL" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                            
                       

                            <table class="PanelTotales">
                                <tr>
                                    <td align="right" width="100px">
                                        Mo. Inafecto</td>
                                    <td align="right" width="120px">
                                        <asp:Label ID="simbol1LBL" runat="server"></asp:Label>
                                        <asp:Label ID="montoInafectoLBL" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        Mo. Afecto</td>
                                    <td align="right" width="120px">
                                        <asp:Label ID="simbol2LBL" runat="server"></asp:Label>
                                        <asp:Label ID="montoAfectoLBL" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        IGV:</td>
                                    <td align="right" valign="100px">
                                        <asp:Label ID="simbol3LBL" runat="server"></asp:Label>
                                        <asp:Label ID="totalIGVLBL" runat="server"></asp:Label>
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="100px">
                                        Total:</td>
                                    <td align="right" valign="100px">
                                        <asp:Label ID="simbol4LBL" runat="server"></asp:Label>
                                        <asp:Label ID="totalLabel" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>


                                 </ContentTemplate>
                            </asp:UpdatePanel>
                           
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Moneda:</td>
                        <td valign="top">
                            <asp:DropDownList ID="monedaDDL" runat="server" Width="200px" Enabled="false">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right" valign="top">
                            Emisor:</td>
                        <td valign="top">
                            <asp:Label ID="vendedorLBL" runat="server"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr >
                        <td align="right" valign="top" width="130px" class="style1">
                            Comentario:</td>
                        <td class="style1">
                            <asp:TextBox ID="comentarioTXT" runat="server" Height="70px" 
                                TextMode="MultiLine" Width="200px"></asp:TextBox>
                        </td>
                        <td class="style1">
                          
                            </td>
                    </tr>
                </table>
            
 
  
      <asp:TabContainer ID="TabContainer1" runat="server"  ActiveTabIndex="0"  
          Width="100%" ><asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Detalle" ><ContentTemplate>
          <asp:Button ID="AddConceptoBTN" runat="server" Text="Agregar Concepto"  
                            OnClick="button"   CssClass="ms-crm-List-Header"    />
                            
                            
                            <asp:modalpopupextender ID="AddDocumentoVentaModal" runat="server" 
              BackgroundCssClass="modalBackground" 
              CancelControlID="cancelarAddButton" dropshadow="True" 
              RepositionMode="None" 
              DynamicServicePath="" Enabled="True" popupcontrolid="AddPendienteParentPanel" 
              popupdraghandlecontrolid="AddPendienteParent" targetcontrolid="LinkButton1"/>
              <asp:LinkButton runat="server" ID="LinkButton1"></asp:LinkButton>
              
                        <uc2:DocumentoVentaItemGrid 
                                ID="DocumentoVentaItemGrid1" runat="server" />
                                
                                
                                
                                </ContentTemplate></asp:TabPanel></asp:TabContainer>
      
      

 
 
   
  </asp:Panel>
   

   

      <asp:Panel ID="AddPendienteParentPanel" runat="server"   CssClass="modalPopup">
  <asp:Panel ID="AddPendienteParent"   runat="server"    
  BorderColor="LightBlue"  BorderStyle="Solid" Style="background-color:#DDDDDD;border:solid 1px Gray;color:Black">
              
 

        <asp:Panel ID="Panel17" runat="server"   >
        
<table width="100%" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer-Right">
               
                    <asp:Button ID="AddPendienteVentaBTN"  runat="server"  Text="Agregar Documento"
                      CssClass="ms-crm-List-Header"  onclick="button"
                          OnClientClick="return confirm('Seguro que desea Agregar los Documentos?')" 
                    />
                  
                    <asp:Button ID="cancelarAddButton"  runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"
                       />
                   
                </td>
   </tr>


   
</table>
        </asp:Panel> 
 <asp:Panel ID="Panel6" runat="server"  
          class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Right">
      <asp:UpdatePanel ID="PendientePagoUpdatePanel" runat="server" UpdateMode="Conditional">
      <ContentTemplate>
  <uc3:PendientePagoPanel ID="PendientePagoPanel2" runat="server" DataSourceID="PendientePagoPanelODS" />

    
     
        <asp:ObjectDataSource ID="PendientePagoPanelODS" runat="server" EnablePaging="True" 
        SelectCountMethod="Count" SelectMethod="Execute" 
        SortParameterName="sortExpression"
        TypeName="BOL.Ventas.GetPendientePagoList">
        <SelectParameters>
             
             <asp:ControlParameter Name="idOrdenVentaItem" Type="Int32" ControlID="idOrdenVentaItemTXT"/>
            <asp:ControlParameter Name="idCliente" Type="Int32" ControlID="idClienteTXT"/>
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
            <asp:Parameter Name="sortExpression" Type="String" />
        </SelectParameters>
        
    </asp:ObjectDataSource>


      </ContentTemplate>


     <Triggers>
<asp:AsyncPostBackTrigger ControlID="TabContainer1$TabPanel1$AddConceptoBTN" />
<asp:AsyncPostBackTrigger ControlID="cancelarAddButton" />



</Triggers>


      
      </asp:UpdatePanel>

       
  
               
           </asp:Panel>






        </asp:Panel>
          </asp:Panel>
      

   
   
    </form>
          
    </body>
</html>
